package net;

import net.chemistry.Atom;
import net.chemistry.AtomID;
import net.chemistry.Molecule;


public class TestingMolecules 
{
	public static void main(String[] args) throws ChemistryException
	{
		System.out.println("Starting");
		
		Atom root = new Atom(AtomID.CARBON);
		
		//construct a benzene molecule
		
		Molecule benzene = new Molecule(root);
		
		benzene.setName("Benzene");
		
		Atom currentCarbon = new Atom(AtomID.CARBON), lastCarbon = root;
		
		for(int n = 0; n < 5; n++)
		{
			benzene.appendAtom(lastCarbon, currentCarbon, (n % 2) + 1, false);
			lastCarbon = currentCarbon;
			currentCarbon = new Atom(AtomID.CARBON);
		}
		
		benzene.appendAtom(root, lastCarbon, 2, false);
		
		for(Atom atom : benzene.getAtoms())
		{
			benzene.appendAtom(atom, new Atom(AtomID.HYDROGEN), 1, false);
		}
		
		System.out.println(benzene);
		
		for(Atom atom : benzene.getAtoms())
		{
			System.out.println(atom);
		}
		
		benzene.resetName();
		
		System.out.println(benzene.getName());
		
		System.out.println("Done");
	}
}
